/**
 * Copyright (c) 2016 Lenovo Group
 * All Rights Reserved.
 * 
 * Project Name:app-gateway
 * Create Time: 2016年2月29日 下午3:47:30
 */
package com.lenovo.lmrp.server.appgateway.mock;

import java.io.File;
import java.net.URL;

import javax.ws.rs.Path;
import javax.ws.rs.core.Response;

import com.lenovo.lmrp.api.appgateway.IStaticResource;
import com.lenovo.lmrp.server.appgateway.util.PropertiesUtil;
import com.lenovo.sdc.framework.annotation.RestService;

/**
 * @author zhangzhenga
 *
 */
@RestService
@Path("/app/v1")
public class MockStaticResourceImpl implements IStaticResource{

    /* (non-Javadoc)
     * @see com.lenovo.lmrp.api.appgateway.IStaticResource#getStaticCSS(java.lang.String)
     */
    @Override
    public File getStaticCSS(String cssFile) {
        // TODO Auto-generated method stub
        return null;
    }

    /* (non-Javadoc)
     * @see com.lenovo.lmrp.api.appgateway.IStaticResource#getStaticImage(java.lang.String)
     */
    @Override
    public File getStaticImage(String imgFile) {
        String imagePath = PropertiesUtil.getStringValue("view.imagepath", "");
        URL url = ClassLoader.getSystemResource("");
        String path = new File(url.getFile() + imagePath).getAbsolutePath();
        File image = new File(path + File.separator + imgFile);
        return image;
    }

    /* (non-Javadoc)
     * @see com.lenovo.lmrp.api.appgateway.IStaticResource#getStaticJS(java.lang.String)
     */
    @Override
    public File getStaticJS(String jsFile) {
        // TODO Auto-generated method stub
        return null;
    }

    /* (non-Javadoc)
     * @see com.lenovo.lmrp.api.appgateway.IStaticResource#getStaticPage(java.lang.String)
     */
    @Override
    public Response getStaticPage(String pageFile) {
        // TODO Auto-generated method stub
        return null;
    }

}
